<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>设置主轴上的子元素的排列方式</title>
    <style>
        div {
            display: flex;
            width: 80%;
            height: 300px;
            background-color: pink;
            /* 设置主轴方向 */
            /* flex-direction: row; */
            flex-direction: column;
            /* 设置子元素在主轴上的排列方式：justify-content属性 */
            /* 从左到右 */
            /* justify-content: flex-start;    */
            /* 从右到左 */
            /* justify-content: flex-end; */
            /* 居中 */
            /* justify-content: center; */
            /* 平分剩余空间 */
            /* justify-content: space-around; */
            /* 俩边贴边，再分配剩余空间 */
            justify-content: space-between;
        }

        span {
            width: 15%;
            height: 100px;
            background-color: skyblue;
        }
    </style>
</head>

<body>
    <div>
        <span>1</span>
        <span>2</span>
        <span>3</span>
        <span>4</span>
    </div>
</body>

</html>